package graphing;

import java.awt.Color;
import java.io.File;
import java.io.FileInputStream;
import java.util.Arrays;

public class filetest {
	
	public static void main(String[] args){
		//double m = FourierUtility.lcm(2, 2*FourierUtility.stepRatio);
		double m = FourierUtility.lcm(2.2, 3.7);
		System.out.println(m);
		/*
		File f = new File("wave.dat");
		byte[] b = new byte[1024];
		int index = 0;
		try {
			FileInputStream in = new FileInputStream(f);
			while(in.available() > 0){
				b[index++] = (byte)in.read();
			}
			in.close();
		} catch (Exception e) {
			e.printStackTrace();
		}
		GraphWindow frame = new GraphWindow();
		//TODO account for clipping on higher wavelengths (subdivide sampling for integration)
		float[] data = FourierUtility.sweepWavelength(b, 0, 256, Waveform.SINE, 220f, true);
		for(int i = 0; i < data.length; i++){
			//System.out.println(data[i]);
		}
		frame.setVisible(true);
		/*
		frame.data = new GraphData[5];
		for(int i = 0; i < 5; i++){
			frame.data[i] = new GraphData();
			frame.data[i].type = GraphData.SEQUENTIAL;
			frame.data[i].displayMethod = GraphData.CONNECTED;
			frame.data[i].autoscale = true;
			frame.data[i].yData = data[i][0][0];
		}
		frame.data[1].color = Color.blue;
		frame.data[2].color = Color.green;
		frame.data[3].color = Color.black;
		frame.data[4].color = Color.magenta;
		add end comment here
		
		
		frame.data = new GraphData[2];
		frame.data[0] = new GraphData();
		frame.data[0].type = GraphData.SEQUENTIAL;
		frame.data[0].displayMethod = GraphData.CONNECTED;
		frame.data[0].autoscale = false;
		frame.data[0].start = -10;
		frame.data[0].delta = .4f;
		frame.data[0].setRange(-50, 50);
		frame.data[0].yData = data;
		frame.data[1] = new GraphData();
		frame.data[1].type = GraphData.SEQUENTIAL;
		frame.data[1].displayMethod = GraphData.CONNECTED;
		frame.data[1].autoscale = false;
		frame.data[1].start = -10;
		frame.data[1].delta = .019f;
		frame.data[1].setRange(-100, 100);
		float[] bytes = new float[1024];
		for(int i = 0; i < 1024; i++){
			bytes[i] = b[i];
		}
		frame.data[1].yData = bytes;
		frame.data[1].color = Color.blue;
		*/
	}
}
